Source code directory structure

The physical organization of your source code directories affects how you set up, and later update your project system.
Essentially, we distinguish between two types of directory structures:

- code packages that have a common root, that is, the structure is homogenous or
- code packages that do not have a common root, that is, the structure is non-homogenous
The first step is therefore to establish what type of directory/package structure you have.

Homogenous directory structures
We strongly recommend that you use this type of structure if possible.
Directory structures are "homogenous" if all source code packages start from a common root directory.

This common root directory does not itself hold source code that is part of any named package, it is simply a common relative starting point, and corresponds to the Java package root. Remember that the Java language specification requires the package root to be one directory level higher than the highest-level directory containing named packages.
The advantages of this type of project:

- You can create a project for the common root directory and have SNiFF+ generate the subproject tree for all subprojects in one step.
- When you set the build options for the entire project structure, you set the root project as the starting point for all source and generated byte-code packages. SNiFF+ can then generate the correct relative paths for all subprojects in one step.
- To synchronize all projects in a Working Environment, you just have to update the root project, since SNiFF automatically updates all the subprojects.
- All paths are relative.

Non-homogenous project structures
This type of project structure demands more complicated settings than the homogenous project type described above.
Project structures are "non-homogenous" if related code packages start from different root directories.

In the above illustration, A and B are homogenous, that is, the package starts from the same root directory. This assumes that no named package code is contained in the root directory
The structure as a whole is, however, non-homogenous because the package scope of C and subdirectories starts from a different root directory.
This has the following implications:

- Projects A and B can be treated as one homogenous project.
- Project C can be treated as one homogenous project.
In this structure, you would have to set up two SNiFF+ Projects. All settings have to be repeated, and a one-step update of all projects is no longer possible.